<%--
  Created by IntelliJ IDEA.
  User: 40937
  Date: 2022/8/19
  Time: 13:59
  To change this template use File | Settings | File Templates.
--%>
<%@ page isELIgnored="false" pageEncoding="utf-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <meta name="renderer" content="webkit">
    <title></title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/pintuer.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/admin.css">
    <script src="${pageContext.request.contextPath}/js/jquery.js"></script>
    <script src="${pageContext.request.contextPath}/js/pintuer.js"></script>
</head>
<body>
<form method="post" action="" id="listform">
    <div class="panel admin-panel">
        <div class="panel-head"><strong class="icon-reorder"> 订单详情</strong> <a href="" style="float:right; display:none;">添加字段</a></div>
        <div class="padding border-bottom">
            <ul class="search" style="padding-left:10px;">
                <li>订单编号:<strong>${order.ID}</strong></li>
                <li>用户:<strong>${order.user.name}</strong></li>

            </ul>
        </div>
        <table class="table table-hover text-center">
            <tr>
                <th width="100" style="text-align:left; padding-left:20px;">商品编号</th>
                <th>商品名称</th>
                <th>商品价格</th>
                <th>商品描述</th>
                <th>商品数量</th>
            </tr>
            <volist name="list" id="vo">
                <c:forEach items="${order.goodsList}" var="good">
                    <tr>
                        <td style="text-align:left; padding-left:20px;"><input type="checkbox" name="id[]" value="" />
                            ${good.id}</td>
                        <td>${good.name}</td>
                        <td>${good.price}</td>
                        <td>${good.description}</td>
                        <td>${good.stock}</td>
                    </tr>
                </c:forEach>
            </volist>
                <tr>
                    <td style="text-align:left; padding:19px 0;padding-left:20px;"><input type="checkbox" id="checkall"/>
                        全选 </td>
                    <td>
                        <input type="button" value="导出为excel表格" style="text-align: right" id="saveExcel">
                    </td>

                    <td colspan="2" style="text-align:right;padding-left:20px;">
                        <ul class="search">
                            <li>订单金额:<strong>${order.totalMoney}</strong></li>
                            <li>订单状态:
                                <strong ><c:if test="${order.status == 0}">已结算</c:if>
                                    <c:if test="${order.status == 1}">未结算
                                        <a href="${pageContext.request.contextPath}/order/updateOrderStatus?ID=${order.ID}" class="button button-little bg-blue"><span class="icon-wrench"></span>结算</a>
                                    </c:if></strong>
                            </li>
                        </ul>
                    </td>
                </tr>
                <tr>
                    <td colspan="8"><div class="pagelist"> <a href="">上一页</a> <span class="current">1</span><a href="">2</a><a href="">3</a><a href="">下一页</a><a href="">尾页</a> </div></td>
                </tr>
        </table>
    </div>
</form>
<script type="text/javascript">

    $("#saveExcel").click(function () {
        window.location.href="${pageContext.request.contextPath}/order/saveExcel?ID=${order.ID}";
    });

    //全选
    $("#checkall").click(function(){
        $("input[name='id[]']").each(function(){
            if (this.checked) {
                this.checked = false;
            }
            else {
                this.checked = true;
            }
        });
    })

</script>
</body>
</html>
